package String_demo;

public class String_demo {

	public static void main(String[] args) {
		for(int i=0;i<32;i++){
			System.out.println(toBin(i));
		}
		
	}
    public static String toBin(int num) {
        char[] chs = new char[5];
        for (int i = 0; i < 5; i++) {
            chs[5 - 1 - i] = (char) ((num >> i & 1) + '0');
        }
        return new String(chs);
    }

}
